package com.market.dao.jpa;

import org.springframework.stereotype.Repository;

import com.market.dao.PurchaseScheduleDao;
import com.market.domain.PurchaseSchedule;

@Repository("purchaseScheduleDao")
public class PurchaseScheduleDaoJpa extends GenericDaoJpa<PurchaseSchedule, Long> implements
		PurchaseScheduleDao {
	public PurchaseScheduleDaoJpa(){
		super(PurchaseSchedule.class);
	}

	public void remove(PurchaseSchedule purchaseSchedule) {
		if(this.findById(purchaseSchedule.getId()) == null){
			log.debug(this.getClass() + " PurchaseSchedule with id " + purchaseSchedule.getId() + " is not found, can not be deleted");
		}else{
			log.debug(this.getClass() + " PurchaseSchedule with id " + purchaseSchedule.getId() + " is found, will be deleted");
			super.removeById(purchaseSchedule.getId());
		}	
		
	}
	
}
